package mobi.weq.util.edinburgh;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import mobi.weq.util.Util;
import mobi.weq.util.map.Coordinate;

public class EdinburghPlaces {
	private static Coordinate getCoordsFromString(String c) {
		String[] tokens = c.substring(1, c.length() - 1).split(",");
		double lat = Double.valueOf(tokens[0].trim());
		double lng = Double.valueOf(tokens[1].trim());
		return new Coordinate(lat, lng);
	}

	private static String getGridIDFromString(String c) {
		String[] tokens = c.substring(1, c.length() - 1).split(",");
		double lat = Double.valueOf(tokens[0].trim());
		double lng = Double.valueOf(tokens[1].trim());

		return Util.getGridId(lat, lng);
	}

	public static void main(String[] args) {
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (String c : POSSIBLE_POLLUTION_LOCATIONS_STRING) {
			String key = getGridIDFromString(c);
			if (!map.containsKey(key)) {
				map.put(key, 0);
			}
			map.put(key, map.get(key) + 1);
		}
		System.out.println(Collections.max(map.values()));
		System.out.println(Collections.min(map.values()));
		System.out.println(map.size());
	}

	public static String[] POSSIBLE_POLLUTION_LOCATIONS_STRING = { "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)", "(55.960384, -3.1715239999999767)", "(55.95342, -3.210888000000068)",
			"(55.94964, -3.2191850000000386)", "(55.892296, -3.0729949999999917)", "(55.950859, -3.211817999999994)", "(55.953585, -3.1948750000000246)",
			"(55.946888, -3.2123699999999644)", "(55.901353, -3.2046589999999924)", "(55.944027, -3.0614960000000337)", "(55.957577, -3.1936210000000074)",
			"(55.944518, -3.2242690000000493)", "(55.944376, -3.2076319999999896)", "(55.97098, -3.18707500000005)", "(55.898852, -3.141764999999964)",
			"(55.945865, -3.2233320000000276)", "(55.949176, -3.187707000000046)", "(55.93783, -3.181510000000003)", "(55.943635, -3.2078940000000102)",
			"(55.945866, -3.2217560000000276)", "(55.94776, -3.2040140000000292)" };
}
